//
//  YCOrderAddressTableViewCell.m
//  lianganyuchu
//
//  Created by iMac on 17/2/28.
//  Copyright © 2017年 杭州桑缇电子商务有限公司. All rights reserved.
//

#import "YCOrderAddressTableViewCell.h"

@implementation YCOrderAddressTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
//    CGFloat width=kMainScreen_Width-2*kDistance;
//    [self.backView addShadowWith:CGSizeMake(width, 160)];
    
    [self.labPhone setFont:[UIFont LightFontOfSize:16]];
    [self.labName setFont:[UIFont LightFontOfSize:16]];
    [self.labAddress setFont:[UIFont LightFontOfSize:16]];
    [self.labelTime setFont:[UIFont LightFontOfSize:16]];
    [self.label1 setFont:[UIFont LightFontOfSize:15]];
    [self.label2 setFont:[UIFont LightFontOfSize:15]];
    [self.label3 setFont:[UIFont LightFontOfSize:15]];
    
    [self.label1 setTextColor:TEXT_LIGHT];
    [self.label2 setTextColor:TEXT_LIGHT];
    [self.label3 setTextColor:TEXT_LIGHT];
    [self.labAddress setTextColor:TEXT_DEEP];
    [self.labelTime setTextColor:TEXT_DEEP];
    [self.labPhone setTextColor:BLUE_COLOR];
    [self.labName setTextColor:TEXT_DEEP];
    
    [self.labPhone click:self action:@selector(phoneClicked:)];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)bindWith:(OrderTable *)order
{
    _order=order;
    [self.labName setText:order.addr_name];
    [self.labelTime setText:order.meal_time];
    [self.labAddress setText:order.addr_address];
    [self.labPhone setText:order.addr_tele];
    
    if (order.addr_address) {
        CGFloat height=getTextSize(order.addr_address, kMainScreen_Width-140, [UIFont LightFontOfSize:16]).height-18;
        CGFloat width=kMainScreen_Width-2*kDistance;
        [self.backView addShadowWith:CGSizeMake(width, 140+height)];
    }
    
}

-(void)phoneClicked:(id)sender
{
     [self.labPhone callPhoneWith:_order.addr_tele];
}


@end
